package com.tjp.eight;

import android.view.View;

import com.tjp.eight.base.BaseActivitySwipe;
import com.tjp.eight.utils.ApplicationUtil;
import com.tjp.eight.utils.SharePreferencesUtils;
import com.tjp.eight.utils.StringUtils;

/**
 * Created by Administrator on 2017/3/29.
 */

public class ActivityWelcome extends BaseActivitySwipe {
    @Override
    public void setFragment() {
        final String lastViersionCode = SharePreferencesUtils.getVersion();

        final String currentCode = ApplicationUtil.getVerCode(ApplicationUtil.getApplicationContext()) + "";

        if (!lastViersionCode.equals(currentCode)&& StringUtils.isNullOrEmpty(lastViersionCode)) {
            SharePreferencesUtils.setVersion(ApplicationUtil.getVerCode(ApplicationUtil.getApplicationContext()) + "");
            changeFragment(new FragGuide());
        } else {
            changeFragment(new FragWelcome());
        }
    }

    @Override
    public void initTitleAll() {
        rl_head_nav.setVisibility(View.GONE);
    }
    public void finish() {
        super.finish();
        overridePendingTransition(R.anim.umeng_socialize_fade_in, R.anim.umeng_socialize_fade_out);
    }
}
